#!/usr/bin/env python3
"""
调试商品API
"""
import traceback

try:
    # 测试导入
    from app.controllers.goods_controller import *
    print("✅ goods_controller 导入成功")
    
    from app.services.goods_service import *
    print("✅ goods_service 导入成功")
    
    from app.repositories.goods_repository import *
    print("✅ goods_repository 导入成功")
    
    # 测试实例化
    from app.repositories.goods_repository import GoodsRepository
    repo = GoodsRepository()
    print("✅ GoodsRepository 实例化成功")
    
    # 测试方法存在
    if hasattr(repo, 'execute_custom_query'):
        print("✅ execute_custom_query 方法存在")
    else:
        print("❌ execute_custom_query 方法不存在")
    
    if hasattr(repo, 'execute_query'):
        print("✅ execute_query 方法存在")
    else:
        print("❌ execute_query 方法不存在")

except Exception as e:
    print(f"❌ 导入或实例化失败: {e}")
    traceback.print_exc()
